package com.woniuxy.microseckillserver.configure;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: 刘康
 * @Date: 2021/1/22 14:07
 * @Description:
 */
@Configuration
public class RedissonConfiguration {

    /**
     * 根据配置信息，产生一个Redisson的客户端对象
     * @return
     */
    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.2.247:6379").setPassword("123456");
        return Redisson.create(config);
    }

}
